package com.rjt.sms.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rjt.common.util.TextUtil;

@Controller
@RequestMapping("api")
@ResponseBody
public class SmsController {
	@PostMapping("getPhone")
	public String getPhone() {
		return "1|1553322"+TextUtil.getRandomNum(4);
	}

	@PostMapping("loginIn")
	public String loginIn() {
		return "1|123123";
	}

	@PostMapping("getMessage")
	public String getMessage() {
		String str="验证码：3454，验证码有效期为5分钟，您正在参加新人百元礼包活动，请妥善保管您的验证码，请勿将验证码泄露给他人。";
		String str2="6591，短信验证码5分钟内有效【中国联通】";
		int num = TextUtil.getRandomNumRang(1);
		if(num>5) {
			return str;
		}
		return str2;
		
	}

	@PostMapping("addBlacklist")
	public String addBlacklist() {
		return "1|操作成功";
	}

	@PostMapping("cancelRecv")
	public String cancelRecv() {
		return "1|操作成功";
	}

	@PostMapping("cancelAllRecv")
	public String cancelAllRecv() {
		return "1|操作成功";
	}

	@PostMapping("getSummary")
	public String getSummary() {
		return "1|888|888|4444|zuozhe";
	}
}
